package com.yc.http.tomcat.impl;

import com.yc.http.tomcat.HttpServletRequest;
import com.yc.http.tomcat.HttpServletResponse;
import com.yc.http.tomcat.ServletException;

import java.io.IOException;
import java.io.PrintWriter;

public class MynameServlet extends HttpServletImpl{

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        response.setContentType("application/json;charset=utf-8");
        Object myname = request.getSession().getAttribute("myname");
        PrintWriter out = response.getWriter();
        out.append(myname==null?"":myname.toString());
    }
}
